import Api from 'api';
export const dictStore = defineStore('dicts', () => {
	const api = new Api
	const dicts = reactive({})
	const getDict = async (code) => {
		dicts[code] || (dicts[code] = code == 'country' ? await api.nationInfo({
			code
		}) : await api.dict({
			code
		}))
		return dicts[code]
	}
	return {
		getDict
	}
})